UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KPTrM/eXZRTpPFmHjJ8EeFy4rfSbcHf42I4XcF8LLLc='
WHERE
key_id = '9b9dc295b7a5c186beb0f6331581e9fff435807c91d9f75db6f028f5ddd54ce7'
AND (
token = 'KPTrM/eXZRTpPFmHjJ8EeFy4rfSbcHf42I4XcF8LLLc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)