UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PekbRFX51oRX71e4Q+7kWZbVn2kaTr8d4bJMgnGRiZ4=' 
WHERE 
  key_id = '53163adf649ca5701d7a8a07b5fdb28a47b22e43b3f9cff1589a6e2e275da5f6' 
  AND (
    token = 'PekbRFX51oRX71e4Q+7kWZbVn2kaTr8d4bJMgnGRiZ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017