UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J15G7uTyNUBN/TZSAbfPJZAetPJIJ9C86C3RGgCOzkk=' 
WHERE 
  key_id = '445a326f2a1e11e5ba37ffc0afed6e2cc6aae3510c9f65ee52e809e3608a717c' 
  AND (
    token = 'J15G7uTyNUBN/TZSAbfPJZAetPJIJ9C86C3RGgCOzkk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044