UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ens6MWc8pIuCDSUJTGoFxK1J+4ZPu8geiogyCs8KI80=' 
WHERE 
  key_id = '755a3701ca1990c5b47fe5479b80b73b06f5f3bd703c076c87547325bd473395' 
  AND (
    token = 'Ens6MWc8pIuCDSUJTGoFxK1J+4ZPu8geiogyCs8KI80=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040