UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nLsJpLjJ3P555LgQLqwbxJTksqJexQb0htauALySa6k='
WHERE
key_id = '0154d6e8e4ad8733578d716fa4f58ce3496504196f8c05b5ad918ca4e84229de'
AND (
token = 'nLsJpLjJ3P555LgQLqwbxJTksqJexQb0htauALySa6k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)