UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5wGOR4GwuiLyKwJNhSydq11c3i8nbpFwsYVD7jDTCaU='
WHERE
key_id = '94cb4ebab3eb5c630b7c0633cc7196c4b35449445a834942897e3fabba8a0a70'
AND (
token = '5wGOR4GwuiLyKwJNhSydq11c3i8nbpFwsYVD7jDTCaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)