UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GSXl8GE80ptRQJ+9pXsDyB+qTmylZ10Ce70BvRiwo50=' 
WHERE 
  key_id = '71fb133eca0d0551b9c42cc343dcf3dfab6348f9e4b2196603df67c4eb9a6182' 
  AND (
    token = 'GSXl8GE80ptRQJ+9pXsDyB+qTmylZ10Ce70BvRiwo50=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00122