UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K4ufEBQJDKm4BL+MnAzplNRy2VjnLlbgSI8LH5HWBFY='
WHERE
key_id = '7a9ad3350698b864e5af9ae94d1c923a9e1fd8800f769017383ca7a3d00098b4'
AND (
token = 'K4ufEBQJDKm4BL+MnAzplNRy2VjnLlbgSI8LH5HWBFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)