UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Av5cCnt3SVp8ii/Zvrot+w8ZGp36P6VUWaIgrvQdBVY=' 
WHERE 
  key_id = '36a78e9d335362e66c4c6746c9abfcd491acf35f3223ed2998caa21fea664e5a' 
  AND (
    token = 'Av5cCnt3SVp8ii/Zvrot+w8ZGp36P6VUWaIgrvQdBVY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018