UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ojMM7H5UpJ4AHzae1/+tm6tzpBOKJVmRdTdPzbXjZx8=' 
WHERE 
  key_id = 'a4ac974d32727379172f96efc6110388399fa3fd722673ba6f8ce32de1205289' 
  AND (
    token = 'ojMM7H5UpJ4AHzae1/+tm6tzpBOKJVmRdTdPzbXjZx8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00183