UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4uUtTD6J2RjoaoAjfOL/Ja7DzZDibrGmnBByL+IJxoI=' 
WHERE 
  key_id = '0c8946bacf8c46babcd21b2a51ac802cb2c2b7605e1ff95dda0cd7b9b8d246aa' 
  AND (
    token = '4uUtTD6J2RjoaoAjfOL/Ja7DzZDibrGmnBByL+IJxoI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018