UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UdBGd922DWkWTx2tgfCLi7YNHt++MbpT/HZ7rJOmZQQ=' 
WHERE 
  key_id = '8e315e8d800780eee24fbd9134f6d8bf0ad70a6d8b64a89803f85eeb155d294c' 
  AND (
    token = 'UdBGd922DWkWTx2tgfCLi7YNHt++MbpT/HZ7rJOmZQQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055