UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wl6dSJ5QO4U8x26wJ4Nz9caGcaLA5r9ZuDN2SrLSLks='
WHERE
key_id = '151d1d96b59a21b568e63bbcd28ad9ed042a215e0f875510fa096c8b35459eb0'
AND (
token = 'Wl6dSJ5QO4U8x26wJ4Nz9caGcaLA5r9ZuDN2SrLSLks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)