UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a7wAL4TXuML4m+QKKdqSqegzCvGerCbEDDzQ6D37Beg=' 
WHERE 
  key_id = '5e9b0fb45217b855c95a99b152bdbcd7603ee5b12b3a5c536fea082d85cf5f2e' 
  AND (
    token = 'a7wAL4TXuML4m+QKKdqSqegzCvGerCbEDDzQ6D37Beg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014