UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qx+ybzYXQIT0RUxNOa+MzebWHeUztIFNGW/LmYyH9wA=' 
WHERE 
  key_id = 'e5bea36ec37ffbd23c28dba29919d319a465642e041f0bc692dac42555f6aee7' 
  AND (
    token = 'Qx+ybzYXQIT0RUxNOa+MzebWHeUztIFNGW/LmYyH9wA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034