UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zyAdOoUSdDyIuPFpPnT76wVGydaXnqCdKePSRAomeQg='
WHERE
key_id = 'f48a1f0c02343c11f27e923455a7d6e7953dad8478190bf9064ae31945216854'
AND (
token = 'zyAdOoUSdDyIuPFpPnT76wVGydaXnqCdKePSRAomeQg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)