UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fMVW9SGNj8SMMSdrGEGfqJi9MfrDqYgOaXrSH3JgjN4=' 
WHERE 
  key_id = '301538e1b0ae7db88c863b1089de5472d43e436a04e994872e2dcd758492eacb' 
  AND (
    token = 'fMVW9SGNj8SMMSdrGEGfqJi9MfrDqYgOaXrSH3JgjN4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056