UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZCUQhRO/mGvhewGvMQkI+AXwk6vSbCwXmxBKr97+/9w=' 
WHERE 
  key_id = '7f191f1f798f1f67b6c3eae46f033e140e900439055f29230985eacdd29b3d9d' 
  AND (
    token = 'ZCUQhRO/mGvhewGvMQkI+AXwk6vSbCwXmxBKr97+/9w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030