UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EWoQauS5aZhGGqpRCVXu4Y9/vOlIQIXB1dXnis7xAXY=' 
WHERE 
  key_id = '4577de6f6b2962727fc5f9d85e89c8927e8a5edd86f7e3ca53ec43d223f3f045' 
  AND (
    token = 'EWoQauS5aZhGGqpRCVXu4Y9/vOlIQIXB1dXnis7xAXY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048