UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1VAtPVl48biA2ir2+VQ9toyf8Pexzu7BANNDUk6oBaY=' 
WHERE 
  key_id = '33bb5bdc0582a04f40da843173557dd4cf4a95be0149b54248a7f09800ce7469' 
  AND (
    token = '1VAtPVl48biA2ir2+VQ9toyf8Pexzu7BANNDUk6oBaY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062