UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Crmi1v2UQmozpq3JrqspT97Z8YYBXG1d3JhciXFVDIc=' 
WHERE 
  key_id = '52a618912fd4b591f1f5f6622dc0ac002247eadc6ac769d4bddb05fe945a9d42' 
  AND (
    token = 'Crmi1v2UQmozpq3JrqspT97Z8YYBXG1d3JhciXFVDIc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016