UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sk5bpfuSqyvAV+krrFItN2Q9u4SMDEUCiwf9tttR168='
WHERE
key_id = '35ab8da6655f05128ba782939a33831f53b6bc61f53f268f645aaff76ab12dba'
AND (
token = 'sk5bpfuSqyvAV+krrFItN2Q9u4SMDEUCiwf9tttR168='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)