UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ool0OqoEVLK306yQCB388soQaprY7XSNt9ZnQvdwh6k=' 
WHERE 
  key_id = '628abddb82c8066b6238fed39fb970d96601442a3148ecd8ccab18c566a316c1' 
  AND (
    token = 'Ool0OqoEVLK306yQCB388soQaprY7XSNt9ZnQvdwh6k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022