UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bP6KXPiKK1a5g01G59BFgw4S5/XM4jVvnM36oPbXzm4=' 
WHERE 
  key_id = '75fdd8e66ea56401336c5204c61bf6b908c4eb3b74f9b3bff4996303666daf79' 
  AND (
    token = 'bP6KXPiKK1a5g01G59BFgw4S5/XM4jVvnM36oPbXzm4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034