UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kUlD8wrkE8UiMIJ4XJFQqpDmdSDaCMb1bqwf+d/Bx6A=' 
WHERE 
  key_id = 'fd600d6902b4cb0f3e37e2c8818be06f793661cb5a23e1c36448344011bdb854' 
  AND (
    token = 'kUlD8wrkE8UiMIJ4XJFQqpDmdSDaCMb1bqwf+d/Bx6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040