UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lYCb4GtHINHjS/EwsQAVLTMKj8E73tY6xPvQxq3Uiik=' 
WHERE 
  key_id = '3efbcd2b7cadabf13122aaf47ed9a9e3037fe303021df6f750e00a40ca2cf927' 
  AND (
    token = 'lYCb4GtHINHjS/EwsQAVLTMKj8E73tY6xPvQxq3Uiik=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018