UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4vYuJ8hOQCCXye69p2fAv+H+6otqHHe5xb6Z3hWNVN0=' 
WHERE 
  key_id = '460a90f9cac18f1fa8accbe736dbd1c408add9d225313970fdb50722d8a7d3ad' 
  AND (
    token = '4vYuJ8hOQCCXye69p2fAv+H+6otqHHe5xb6Z3hWNVN0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033